<template>
  <div>
    <header></header>

    <div class="header-top">
      <div class="toux">
        <img src="../assets/images/头像男 拷贝 4.png" alt="" />
        <p>{{ userArr.remark }}!!!!</p>
      </div>
      <div class="namep">
        <span> <i>姓名</i>{{ userArr.nickName }}</span>
        <span> <i>联系方式</i>{{ userArr.phone }}</span>
      </div>
    </div>

    <div class="personal-bottom">
      <van-cell
        title="个人中心"
        :icon="require('../assets/images/Personal information.png')"
        is-link
        @click="$router.push('/personDetail')"
      />
      <van-cell
        title="支付中心"
        :icon="require('../assets/images/形状 2.png')"
        is-link
      /><van-cell
        title="修改密码"
        :icon="require('../assets/images/change Password.png')"
        is-link
      /><van-cell
        title="版本信息"
        :icon="require('../assets/images/版本信息.png')"
        is-link
        value="版本信息1.0"
        @click="$router.push('/banben')"
      /><van-cell
        title="消息缓存"
        :icon="require('../assets/images/清除缓存.png')"
        is-link
      />
    </div>

    <div class="quitLogin">
      <button @click="quitClick">退出登录</button>
    </div>

    <van-overlay v-show="show">
      <div class="wrapper" @click.stop>
        <div class="block">
          <h1>确定退出登录吗?</h1>
          <div>
            <span @click="show = false">取消</span>
            <span @click="queClick">确定</span>
          </div>
        </div>
      </div>
    </van-overlay>

    <div class="tab">
      <van-tabbar v-model="active">
         <van-tabbar-item
          :icon="require('../assets/images/矢量智能对象-2.png')"
          @click="pesClick"
          >系统功能</van-tabbar-item
        >
        <van-tabbar-item v-if="active == 1">
          <span>个人中心</span>
          <template #icon="props">
            <img :src="props.active ? icon.active : icon.inactive" />
          </template>
        </van-tabbar-item>

       
      </van-tabbar>

      <div class="circle">
        <img src="../assets/images/lianxi.png" alt="" />
        <p>联系</p>
      </div>
    </div>
  </div>
</template>

<script>
import { usershow } from "../request/api";
export default {
  data() {
    return {
      userArr: [],
      show: false,
      active: 1,
      icon: {
        active: require("../assets/images/矢量智能对象.png"),
        inactive: require("../assets/images/个人中心.png"),
      },
    };
  },
  created() {
    usershow().then((res) => {
      //   console.log(res);
      this.userArr = res.data;
    });
  },
  methods: {
    quitClick() {
      this.show = true;
    },
    queClick() {
      this.$router.push("/longinHome");
    },
   
    pesClick() {
      this.$router.push("/home");
    },
  },
};
</script>
 
<style lang = "less" scoped>
header {
  background: #003399;
  width: 100%;
  height: 150px;
}

.header-top {
  background-color: #fff;
  height: 130px;
  width: 90%;
  margin: auto;
  border-radius: 5px;
  margin-top: -55px;
  position: relative;
  padding: 0 5px;
  box-sizing: border-box;
  .toux {
    height: 80px;
    border-bottom: 1px solid #efefef;

    img {
      width: 28%;
      position: absolute;
      top: -50px;
      left: 50%;
      margin-left: -12%;
      box-shadow: 0px 2px 3px 3px #fff;
      border-radius: 50%;
      display: block;
    }

    p {
      padding: 60px 0 0 110px;
      font-size: 14px;
      color: #666;
    }
  }
  .namep {
    display: flex;
    justify-content: space-between;
    align-items: center;
    line-height: 50px;
    font-size: 14px;
    i {
      color: #999;
      margin-right: 10px;
    }
  }
}

.personal-bottom {
  width: 90%;
  margin: 10px auto;
  border-radius: 5px;
  overflow: hidden;
  .van-icon__image {
    margin-right: 5px;
  }
}

.quitLogin {
  width: 90%;
  margin: 80px auto;
  button {
    padding: 15px 0;
    width: 100%;
    border: 0;
    background-color: #efefef;
    border-radius: 5px;
    color: #999;
  }
}

.wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.block {
  width: 70%;
  /* height: 120px; */
  background-color: #fff;
  border-radius: 5px;

  h1 {
    padding: 25px;
    text-align: center;
    border-bottom: 1px solid #e5e5e5;
  }
  div {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    height: 40px;
    span {
      width: 50%;
      user-select: none;
      &:nth-of-type(1) {
        border-right: 1px solid #e5e5e5;
      }
      &:nth-of-type(2) {
        color: skyblue;
      }
    }
  }
}

.tab {
  height: 50px;
  width: 100%;
  position: fixed;
  bottom: 0;
  left: 0;
  background-color: #fff;
  font-size: 26px;

  .circle {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: -20px;
    background-color: #ffcc33;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    box-sizing: border-box;
    border: 4px solid #efefef;
    color: #fff;
    z-index: 99;
    font-size: 14px;
    box-sizing: border-box;

    img {
      width: 24px;
      height: 24px;
      margin-bottom: 3px;
      display: block;
    }
  }
}
</style>